import { Entity, PrimaryUuid, UpdateDate, CreateDate, Openid, MemberId, DateTime, GymTeacherId, GymCourseId, GymCourseType, GymAppointmentStatus, GymPlaceId, Time, Date, GymScheduleId, Digdit } from '@sker/core'
/**
 * 记录预约信息，包括预约ID、用户ID、教练ID、课程ID、预约时间、预约状态等字段。
 */
@Entity({
    name: 'gym_appointment',
})
export class GymAppointment {
    static title: string = `健身预约`;
    static resource: string = `gym_appointment`;

    @PrimaryUuid({
        primaryKeyConstraintName: 'PK_GYM_APPOINTMENT_ID'
    })
    id!: string;

    @Openid({ label: '微信', hide: true })
    openid!: string;

    @MemberId({ label: '微信' })
    member_id!: string;

    @GymScheduleId({ nullable: true })
    schedule_id: string;

    @GymTeacherId({ comment: '教练', nullable: true })
    teacher_id!: string;

    @GymCourseId({ comment: '课程', nullable: true })
    course_id!: string;

    @GymPlaceId({ comment: '地点', nullable: true })
    place_id!: string;

    @Time({ comment: '开始时间', nullable: true })
    start_time!: Date;

    @Time({ comment: '结束时间', nullable: true })
    end_time!: Date;

    @Date({ nullable: true })
    date!: Date

    @GymAppointmentStatus({ label: '状态', comment: '状态，0=预约中 1=待签到 2=迟到 3=缺席 4=完成' })
    status!: number;

    @GymCourseType({ comment: '类型' })
    type!: number;

    @Digdit({ default: 0 })
    sign_count: number;

    @CreateDate({
        comment: '创建日期'
    })
    create_date!: Date;

    @UpdateDate({
        comment: '更新日期'
    })
    update_date!: Date;
}